<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
   <h1 id="header">Первый заголовок</h1> 
   <script>
       console.log('Hello, world!');

       const el = document.querySelector('#header');

       el.addEventListener('click', function() {
            console.log('Click1!');
            el.textContent = "Привет от JavaScript!";
       });
       el.addEventListener('click', function(event) {
            console.log('Click2!');
            event.target.style.color = "red";
       });
       
   </script>
</body>
</html>